package com.bw.domain;

import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Date;

public class Goods implements Serializable {
    private Integer id;
    @NotBlank(message = "商品名称不能为空")
    @Size(min = 2,max = 10,message = "商品名称的长度必须在2-10之间")
    private String name;
    @NotBlank(message = "商品名称不能为空")
    @Size(min = 5,max = 20,message = "商品描述的长度必须在5-20之间")
    private String ms;
    @NotNull(message = "价格必填")

    @Min(value = 1,message = "价格最低是1")
    @Max(value = 9999,message = "价格最高是9999")
    private Double price;
    @NotBlank(message = "商品图片必须上传")
    private String picurl;
    //@Future
    private Date created;
    @NotNull(message = "所属品牌必须选择")
    private Integer bid;//所属品牌id
    @NotNull(message = "状态必须选择")
    private Integer status;//0 上架 1 下架

    private Integer type1;//一级分类
    private Integer type2;//二级分类
    private Integer type3;//三级分类


    private String typename1;//一级分类名称
    private String typename2;//二级分类名称
    private String typename3;//三级分类名称

    public String getTypename1() {
        return typename1;
    }

    public void setTypename1(String typename1) {
        this.typename1 = typename1;
    }

    public String getTypename2() {
        return typename2;
    }

    public void setTypename2(String typename2) {
        this.typename2 = typename2;
    }

    public String getTypename3() {
        return typename3;
    }

    public void setTypename3(String typename3) {
        this.typename3 = typename3;
    }

    private String bname;

    public Integer getType1() {
        return type1;
    }

    public void setType1(Integer type1) {
        this.type1 = type1;
    }

    public Integer getType2() {
        return type2;
    }

    public void setType2(Integer type2) {
        this.type2 = type2;
    }

    public Integer getType3() {
        return type3;
    }

    public void setType3(Integer type3) {
        this.type3 = type3;
    }

    @Override
    public String toString() {
        return "Goods{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", ms='" + ms + '\'' +
                ", price=" + price +
                ", picurl='" + picurl + '\'' +
                ", created=" + created +
                ", bid=" + bid +
                ", status=" + status +
                ", bname='" + bname + '\'' +
                '}';
    }

    public String getMs() {
        return ms;
    }

    public void setMs(String ms) {
        this.ms = ms;
    }

    public String getBname() {
        return bname;
    }

    public void setBname(String bname) {
        this.bname = bname;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getPicurl() {
        return picurl;
    }

    public void setPicurl(String picurl) {
        this.picurl = picurl;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Integer getBid() {
        return bid;
    }

    public void setBid(Integer bid) {
        this.bid = bid;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
